package org.yellow.backend.webconfig;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author: hy
 * @create: 2024-01-05
 */
@Configuration
public class RestTemplateConfig {

    /**
     * 注入RestTemplate对象
     * @return
     */
    @ConditionalOnMissingBean(RestTemplate.class)
    @Bean
    public RestTemplate restTemplate(){

        return new RestTemplate();
    }
}
